Don't do device create on domain recreate.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Mon, 19 Sep 2005 13:23:22 +0000 (13:23 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Mon, 19 Sep 2005 13:23:22 +0000 (13:23 +0000)
Also don't add XendDomainInfo object to XendDomain dictionary from
XendDomainInfo object but do it in XendDomain.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
tools/python/xen/xend/XendDomain.py
tools/python/xen/xend/XendDomainInfo.py

index e835ea9063cb3d540bed8646b5df94c77ae2bd6b..93427e98513ec633e97422a8fbc9d5da80047d2c 100644 (file)
@@ -276,6 +276,7 @@ class XendDomain:
         @return: domain
         """
         dominfo = XendDomainInfo.create(self.dbmap, config)
+        self._add_domain(dominfo)
         return dominfo
 
     def domain_restart(self, dominfo):
index f26323cb94e10c7aa83c08cadf541e77149f027e..db33cecae77de9a36d96072866852465c5f3f260 100644 (file)
@@ -538,7 +538,6 @@ class XendDomainInfo:
             self.init_image()
             self.configure_cpus(config)
             self.init_domain()
-            self.register_domain()
 
             # Create domain devices.
             self.configure_backends()
@@ -554,11 +553,6 @@ class XendDomainInfo:
             self.destroy()
             raise
 
-    def register_domain(self):
-        xd = get_component('xen.xend.XendDomain')
-        xd._add_domain(self)
-        self.exportToDB(save=True)
-
     def configure_cpus(self, config):
         try:
             self.cpu_weight = float(sxp.child_value(config, 'cpu_weight', '1'))
@@ -746,6 +740,8 @@ class XendDomainInfo:
 
         @raise: VmError for invalid devices
         """
+        if self.recreate:
+            return
         if not self.rebooting():
             self.create_configured_devices()
         self.image.createDeviceModel()